create or replace procedure rssClob_Download(rssid in number ,fName in varchar2)
as
        l_blob  clob;
        l_bfile bfile;

begin
        insert into rssFile (rssF_id,rssD_id,rssF_clob) VALUES (rssQF.NEXTVAL,rssid, empty_clob() )
        returning rssF_Clob into l_blob;

        l_bfile := bfilename( 'DOWNLOAD',fName );
        dbms_lob.fileopen( l_bfile);

        dbms_lob.loadfromfile( l_blob, l_bfile, dbms_lob.getlength( l_bfile));
        dbms_lob.fileclose( l_bfile );
end;
/

